package REUtils;

import globalpara.*;
import java.util.*;

public class showMsg {
	

	//Print infotrmation for DEBUG
	public static void DEBUG(String debugstr){
	  if(Gpara.ENABLE_DEBUG){	
		System.out.println("DEBUG: "+debugstr);
	  }	
	}//DEBUG
	
	//Print infotrmation for INFO
	public static void INFO(String debugstr){
	  if(Gpara.ENABLE_INFO){	
		System.out.println("INFO: "+debugstr);
	  }	
	}//INFO
	
	//Print infotrmation for WARNING
	public static void WARN(String debugstr){
	  if(Gpara.ENABLE_WARNING){	
		System.out.println("WARN: "+debugstr);
	  }	
	}//WARN
	//Print infotrmation for ERROR
	public static void ERR(String debugstr){
		System.out.println("ERROR: "+debugstr);
	}//ERROR Message
	
	public static boolean prnList(String funname,List<String> ListStore){
		if(!(ListStore.isEmpty())){
		int k=0;
		  for(String sValue : ListStore) {
		    showMsg.DEBUG(funname+" :"+k+": "+sValue);
	  	    k++;
	      }
		 return true; 
		}else{return false;} 
	}
	
	
	public static long calTime(int RUN){

		
		if(RUN == 1){	
			Gpara.StartTime = System.currentTimeMillis(); // 取出目前時間	   
		}else{	
			Gpara.ProcessTime = System.currentTimeMillis() - Gpara.StartTime; // 計算處理時間
			Gpara.AverageTime += Gpara.ProcessTime; // 累積計算時間  
		}
		
		return Gpara.AverageTime ; 
	}
	
	
}

//static public class Timeinfo{

//}
